<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="../../ui/js/jQuery.js"></script>
<script type="text/javascript">
$(document).ready( function(){
	//全部选中
	$('#selectall').click( function (){
		//alert('1');
		$('.checked').attr("checked","checked");
		}
	);
	//全部取消
	$('#freeall').click( function (){
	//alert('1');
	$('.checked').removeAttr("checked");
	});
	
 }
);
</script>
</head>
<body>
<?php 
require_once '../config.php';

/*
 文件下载，打包下载  文件验证
*/

?> 
<form action="download.php" method="post">
<table>
<tr>
<th>编号</th><th>文件名</th><th>下载</th><th>删除</th>
</tr>
<?php

//要求用户登录成功后赋值如下
//$user_power=$_SESSION['bid'];

//先比较
$sql="SELECT * FROM file 
	  HAVING level<=7";
//4替换成用户的权限

$query = $db_file->query($sql);
while( $file = $db_file->fetch_array($query))
{	
		//var_dump($file_power);
		?>
		<tr>
		<td><?php echo $file['file_id']; ?></td>
		<td><?php echo $file['name']; ?></td>
		<td><input  class="checked" type="checkbox" name="down_load[]"  value="<?php echo $file['file_id']; ?>" /></td>
		<td><input  type="checkbox" name="delete_file[]"  value="<?php echo $file['file_id']; ?>" /></td>
		</tr>
		<?php
}
?>
<tr><input  type="button" id="freeall" value="全部取消"/><input  type="button" id="selectall" value="全部选中"/><input type="submit" name="down"  value="下载" /><input  type="submit" name="delete"  value="删除" /></tr>
</table>
</form>

</body>
</html>